
VER = 1.31
BNAME = sqlim-$(VER)
TARBZ = $(BNAME).tar.bz2

TPL =              \
tpl/sqlim.css      \
tpl/footer.tpl     \
tpl/header.tpl     \
tpl/period.tpl     \
tpl/ulist.tpl      \
tpl/user.tpl       \
tpl/users.tpl      \
tpl/detail.tpl

CGI =              \
cgi-bin/detail.cgi \
cgi-bin/index.cgi 

OTHER =            \
db.sql             \
history.txt        \
readme.txt

CMD =              \
pass_basic         \
pass_basic_del     \
sq2db.pl           \
sqlim_acl.pl       \
sqlim_sum.pl       \
util.pl            \
config.pl   

SRC = $(TPL) $(CGI) $(CMD) $(OTHER)

all: $(TARBZ)

$(TARBZ): $(SRC)
	chmod +x $(CGI) $(CMD)
	mkdir $(BNAME)
	cp $(OTHER) $(CMD) $(BNAME)/
	mkdir $(BNAME)/tpl
	cp $(TPL) $(BNAME)/tpl/
	mkdir $(BNAME)/cgi-bin
	cp $(CGI) $(BNAME)/cgi-bin/
	tar -cf - $(BNAME) | bzip2 >$(TARBZ)
	rm -drf ./$(BNAME)

clean:
	rm $(TARBZ)
